<?php


namespace app\adminapi\controller;

use app\adminapi\logic\WorkbenchLogic;
use app\common\model\user\OpenvpnDept;

/**
 * 工作台
 * Class WorkbenchCotroller
 * @package app\adminapi\controller
 */
class WorkbenchController extends BaseAdminController
{

    /**
     * @notes 工作台
     * @return \think\response\Json
     * @date 2021/12/29 17:01
     */
    public function index()
    {
        $where = [];
        if ($this->adminId != 1) {
            $openvpnDept = OpenvpnDept::where('dept_id', $this->adminInfo['dept_id'])->column('vpn_id');
            $where[] = ['id', 'in', $openvpnDept];
        }
        $result = WorkbenchLogic::index($where);
        return $this->data($result);
    }
}